home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / ask.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  64 lines

  1. #ifndef __ASK_H_
  2. #define __ASK_H_
  3. /* Querry editor. Provides facilities for querries, examples and checks
  4.     input to table.
  5. */
  6.  
  7. #include "abstable.h"
  8. #include "khquerry.h"
  9.  
  10. #define QUERRY_MAX_LEN 250
  11. #define EXAMPLE_MAX_LEN 8
  12.  
  13. class Ask : public KH_AbstractTable
  14.     {
  15.     protected:
  16.     char* tableName;              // Name of table to querry
  17.     KH_STRTABLE* querry;          // Querry to the table
  18.     KH_STRTABLE* examples;        // Examples to the Querry
  19.     char* checkers;               // Checked fields
  20.  
  21.     KH_STRTABLE* fieldNames;         // Names of fields
  22.  
  23.     public:
  24.     Ask(rect coordinates, char* tabName, KH_STRTABLE* fields,
  25.            char* fName = "",
  26.            int s = 0, BORDERS b_type = SHOW_BORDER,
  27.            int res = 0, int pat = 0, int hdr_pat = 0);
  28.  
  29.     ~Ask() { delete tableName; delete querry; delete examples;
  30.          delete checkers; delete fieldNames;
  31.          delete colNumbers; delete iColWidth; }
  32.  
  33.     virtual void getFieldName(char* name, int n);
  34. //    virtual void repose(rect new_pos);
  35.     virtual long RecordNumber()    { return 1L; }
  36.     virtual int getColumnNumber()  { return nColumns; }
  37.  
  38.     virtual void showField(int xcell, int x, int y, int flag,
  39.                    int field_type);
  40.  
  41.     virtual int getFieldType(int x, int y) { return 0; }
  42.  
  43.     virtual void show();
  44. //    virtual void exe(int act = 0);
  45.     virtual int writeAccess() { return 1; }
  46.     virtual void saveTable() {}
  47.  
  48. //    virtual int check_type(int type, char* string) {}
  49.  
  50.     virtual void editField();
  51.     virtual int searchField(int ask);
  52.     virtual int getFieldMaxWidth();
  53.  
  54. /* After processing of touch() function global_num is set to the
  55.      number of fields in table (fieldNames->used), global[1 - global_num]
  56.      is set to querry strings, global[global_num + 1] is set to checkers,
  57.      global[global_num + 2] is set to tableName, and
  58.      global[global_num + 3 to 2 * global_num + 3] is set to examples
  59.      strings. global[0] is set to "Ask" string.
  60. */
  61.     virtual void touch(int i = 0);
  62.     };
  63.  
  64. #endif __ASK_H_